<template>
  <div class="statisticalanalysis">
    <el-button @click="print" class="signs print" v-if="list.shStatus==2">打印</el-button>  
    <el-tooltip class="item" effect="dark" content="审核通过才可以打印" v-else placement="top-start">
        <el-button class="signs print" style="cursor:not-allowed;">打印</el-button>  
    </el-tooltip>
    <div ref="print">
        <el-card class="box-card">
           <div style="width:100%;text-align:center;">
              <span style="height:45px;display:inline-block;line-height:45px;font-weight:700;">吊装安全作业证</span>
           </div>
           <table border="1" cellspacing="0">
                <tr align="center" height="35px" >
                  <td colspan="2">吊装地点</td>
                  <td colspan="2"><span v-text="list.dzdd"></span></td>
                  <td colspan="2">吊装工具名称</td>
                  <td colspan="2"><span v-text="list.dzgjmc"></span></td>
                  <td colspan="2">作业证编号</td>
                  <td colspan="2"><span v-text="list.zyzbh"></span></td>
                </tr>
                <tr align="center" height="35x">
                  <td colspan="3">吊装人员及特殊工种作业证号</td>
                  <td colspan="3" v-text="list.dzryzyzh"></td>
                  <td colspan="3">监护人</td>
                  <td colspan="3" v-text="list.jhrmc"></td>
                </tr>
                <tr align="center" height="35x">
                  <td colspan="3">吊装指挥及特殊工种作业证号</td>
                  <td colspan="3" v-text="list.dzzhzyzh"></td>
                  <td colspan="3">起吊重物质量（t）</td>
                  <td colspan="3" v-text="list.qdzwzl"></td>
                </tr>
                <tr align="center" height="35x">
                  <td colspan="2">作业时间</td>
                  <td colspan="10" style="padding-right:4rem;">
                     自
                     <span v-text="list.dzzykssj"></span>始至&nbsp;&nbsp;
                     <span v-text="list.dzzyjssj"></span>止
                  </td>
                </tr>
                <tr height="35x">
                  <td align="center" colspan="2">吊装内容</td>
                  <td colspan="10" v-text="list.dznr" style="padding-left:2rem;"></td>
                </tr>
                <tr height="80x">
                  <td align="center" colspan="2">危害辨识</td>
                  <td colspan="10" v-text="list.whbs" style="padding-left:2rem;"></td>
                </tr>
                <tr align="center" height="35px">
                  <td>序号</td>
                  <td colspan="10">安全措施</td>
                  <td colspan="2">确认人</td>
                </tr>
                <tr align="center" height="40px">
                  <td>1</td>
                  <td align="left" class="textleft" colspan="10">吊装质量大于等于40t的重物和土建工程主体结构；吊装物体虽不足40t，但形状复杂、刚度小、长径比大、精密贵重，作业条件特殊，需编制吊装作业方案，且经作业主管部门和安全管理部门审查，报主管（副总经理或总工程师批准）</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>2</td>
                  <td align="left" class="textleft" colspan="10">指派专人监护，并监守岗位，非作业人员禁止入内</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>3</td>
                  <td align="left" class="textleft" colspan="10">作业人员已按规定佩戴防护器具和个体防护用品</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>4</td>
                  <td align="left" class="textleft" colspan="10">已与分厂（车间）负责人取得联系，建立联系信号</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>5</td>
                  <td align="left" class="textleft" colspan="10">已在吊装现场设置安全警戒标志，无关人员不许进入作业现场</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>6</td>
                  <td align="left" class="textleft" colspan="10">夜间作业采用足够的照明</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>7</td>
                  <td align="left" class="textleft" colspan="10">室外作业遇到（大雪/暴雨/大雾/六级以上大风），已停止作业 </td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>8</td>
                  <td align="left" class="textleft" colspan="10">检查起重吊装设备、钢丝绳、揽风绳、链条、吊钩等各种机具，保证安全可靠</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>9</td>
                  <td align="left" class="textleft" colspan="10">分工明确、坚守岗位，并按规定的联络信号，统一指挥</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>10</td>
                  <td align="left" class="textleft" colspan="10">将建筑物、构筑物作为锚点，需经工程处审查核算并批准</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>11</td>
                  <td align="left" class="textleft" colspan="10">吊装绳索、揽风绳、拖拉绳等避免同带电线路接触，并保持安全距离</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>12</td>
                  <td align="left" class="textleft" colspan="10">人员随同吊装重物或吊装机械升降，应采取可靠的安全措施，并经过现场指挥人员批准</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>13</td>
                  <td align="left" class="textleft" colspan="10">利用管道、管架、电杆、机电设备等作吊装锚点，不准吊装</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>14</td>
                  <td align="left" class="textleft" colspan="10">悬吊重物下方站人、通行和工作，不准吊装</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>15</td>
                  <td align="left" class="textleft" colspan="10">超负荷或重物质量不明，不准吊装</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>16</td>
                  <td align="left" class="textleft" colspan="10">斜拉重物、重物埋在地下或重物坚固不牢，绳打结、绳不齐，不准吊装</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>17</td>
                  <td align="left" class="textleft" colspan="10">棱角重物没有衬垫措施，不准吊装</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>18</td>
                  <td align="left" class="textleft" colspan="10">安全装置失灵，不准吊装</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>19</td>
                  <td align="left" class="textleft" colspan="10">用定型起重吊装机械（履带吊车、轮胎吊车、轿式吊车等）进行吊装作业，遵守该定型机械的操作规程</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>20</td>
                  <td align="left" class="textleft" colspan="10">作业过程中应先用低高度、短行程试吊</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>21</td>
                  <td align="left" class="textleft" colspan="10">作业现场出现危险品泄漏，立即停止作业，撤离人员</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>22</td>
                  <td align="left" class="textleft" colspan="10">作业完成后现场杂物已清理</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>23</td>
                  <td align="left" class="textleft" colspan="10">吊装作业人员持有法定的有效的证件</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>24</td>
                  <td align="left" class="textleft" colspan="10">地下通讯电（光）缆、局域网络电（光）缆、排水沟的盖板，承重吊装机械的负重量已确认，保护措施已落实</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>25</td>
                  <td align="left" class="textleft" colspan="10">起吊物的质量(     t)经确认，在吊装机械的承重范围</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>26</td>
                  <td align="left" class="textleft" colspan="10">在吊装高度的管线、电缆桥架已做好防护措施</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>27</td>
                  <td align="left" class="textleft" colspan="10">作业现场围栏、警戒线、警告牌、夜间警示灯已按要求设置</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>28</td>
                  <td align="left" class="textleft" colspan="10">作业高度和转臂范围内，无架空线路</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>29</td>
                  <td align="left" class="textleft" colspan="10">人员出入口和撤离安全措施已落实：A.指示牌；B.指示灯</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>30</td>
                  <td align="left" class="textleft" colspan="10">在爆炸危险生产区域内作业，机动车排气管已装火星熄灭器</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>31</td>
                  <td align="left" class="textleft" colspan="10">现场夜间有充足照明： 36V、24V、12V防水型灯；36V、24V、12V防爆型灯</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td>32</td>
                  <td align="left" class="textleft" colspan="10">作业人员已佩戴防护器具</td>
                  <td colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td rowspan="2">33</td>
                  <td align="left" class="textleft" colspan="10" style="border-bottom:none;">
                    其他安全措施：
                    <span v-text="list.qtaqcs"></span>
                  </td>
                  <td rowspan="2" colspan="2" v-text="list.aqcsqrrmc"></td>
                </tr>
                <tr align="center" height="40px">
                  <td colspan="10" style="border-top:none;">
                    编制人：<span v-text="list.qtaqcsqrrmc"></span>
                  </td>
                </tr>
                <tr algin="center" height="35px">
                  <td colspan="3" style="padding-left:1rem;">实施安全教育人</td>
                  <td colspan="3" v-text="list.ssaqjyrmc" style="padding-left:1rem;"></td>
                  <td colspan="3" v-text="list.ssaqjyrmc" style="padding-left:1rem;"></td>
                  <td colspan="3" v-text="list.ssaqjyrmc" style="padding-left:1rem;"></td>
                </tr>
                <tr algin="center" height="35px">
                  <td colspan="6">生产单位安全部门负责人（签字）：<span v-text="list.scdwaqbmfzrqzmc"></span></td>
                  <td colspan="6">生产单位负责人（签字）：<span v-text="list.scdwfzrqzmc"></span></td>
                </tr>
                <tr algin="center" height="35px">
                  <td colspan="6">作业单位安全部门负责人（签字）：<span v-text="list.zydwaqbmfzrqzmc"></span></td>
                  <td colspan="6">作业单位负责人（签字）：<span v-text="list.zydwfzrqzmc"></span></td>
                </tr>
                <tr height="80px">
                  <td colspan="12" style="border-bottom:none;padding-left:1rem;">
                     审批部门意见：
                     <span v-text="list.spbmyj"></span>
                  </td>
                </tr>
                <tr height="40px">
                  <td align="right" colspan="12" style="border-top:none;padding-right:2rem;">
                     签字：
                     <span v-text="list.spbmqzmc" style="padding-right:2rem;"></span>
                     <span v-text="list.spsj"></span>
                  </td>
                </tr>
            </table>
        </el-card>
    </div>
    
  </div>
</template>

<script>
import Vue from 'vue'
import vueEsign from 'vue-esign'
import printStyle from './printStyle'
export default {
  props: ["list"],
  name: 'dzaq',
  components: {
    vueEsign
  },
  created(){
    console.log(2);
    console.log(this.list);
    this.list.dzzykssj = this.formatDate(this.list.dzzykssj);
    this.list.dzzyjssj = this.formatDate(this.list.dzzyjssj);
    this.list.spsj = this.formatDate(this.list.spsj);
  },
  methods: {
    formatDate(needTime){
      //needTime是整数，否则要parseInt转换
        if(needTime !== null && needTime !== undefined){
          var time = new Date(needTime);
          var y = time.getFullYear();
          var m = time.getMonth()+1;
          var d = time.getDate();
          var h = time.getHours();
          var mm = time.getMinutes();
          // var s = time.getSeconds();
          return y+'年'+this.add0(m)+'月'+this.add0(d)+'日'+this.add0(h)+'时'+this.add0(mm)+'分';
        }else{
          return '  年  月  日 时  分 ';
        }
    },
    add0(m){
      return m<10?'0'+m:m 
    },
    print() {
      let print = this.$refs.print.innerHTML
      let printPart = print + printStyle;
      let newTab = window.open('_blank');
      newTab.document.body.innerHTML = printPart;
      newTab.print();
      newTab.close();
    },
  }
}
</script>

<style lang="scss" scoped>
.statisticalanalysis {
   .signs {
        position: absolute;
        right: 10px;
        top: 70px;
        &.print {
            top: 20px;
            right:50px;
        }
   }
  .box-card {
    width: 80%;
    margin: 0 auto;
    background: #fff;
    color: #606266;
    position: relative;
    table {
       margin: 0 auto;
      margin: 0 auto;
      tr {
        .textleft {
          text-align:left;
          padding-left: 20px;
        }
        span{
          display:inline-block;
          min-width:70px;
        }
      }
      .positon {
        display: block;
        margin-top: -25px;
        margin-top: 35px;
      }
    }
  }
}
</style>